Dec 14, 2025
Hello, World! 👋
Welcome to my brand new blog. This site is special because it’s not just a website—it’s a Digital Garden grown directly from my personal notes.
How This Works
I wrote this article comfortably inside Obsidian, my favorite note-taking tool. I didn’t have to touch any code or copy-paste text into a web browser.
- I write in Obsidian.
- I click a magic button on my Mac.
- It appears here on the internet.
Why “Digital Garden”?
“A garden is a collection of evolving ideas that aren’t strictly raw notes, but aren’t strictly polished articles either.”
Dec 14, 2025


Collecting and preparing Textual Data for Classification

lesson1
Blast off into the world of Textual Data Collection! 🚀 You’re about to unlock the secrets of data science in NLP. Let’s decode the mysteries together!
Introduction to NumPy Arrays
NumPy 数组简介
Let’s delve into Python’s NumPy library and focus on the centerpiece of NumPy - arrays. NumPy, an acronym for ‘Numerical Python’, specializes in efficient computations on arrays. Arrays in NumPy are more efficient than typical Python data structures.
让我们深入探讨 Python 的 NumPy 库,并将重点放在 NumPy 的核心组件—— arrays 上。NumPy 是“Numerical Python”的缩写,专门用于对数组进行高效计算。NumPy 中的数组比典型的 Python 数据结构更高效。
Dec 14, 2025
Winds of change

Today Mars is a cold, dry wasteland, but 44 billion years ago Mars was likely similar to Earth. It had liquid water and could have supported life. Why might Mars be uninhabitable today?
There are many characteristics of a planet that can affect its global average temperature and habitability.

Which of Mars’ traits could be contributing to its freezing temperatures and inhabitability?
Mars’s atmosphere less dense than Earth’s
Dec 14, 2025
Winds of change

Today Mars is a cold, dry wasteland, but 44 billion years ago Mars was likely similar to Earth. It had liquid water and could have supported life. Why might Mars be uninhabitable today?
There are many characteristics of a planet that can affect its global average temperature and habitability.

Which of Mars’ traits could be contributing to its freezing temperatures and inhabitability?
Mars’s atmosphere less dense than Earth’s
Dec 14, 2025
Expansive Effects
To understand our neighborhood — the Moon, the Sun, and the rest of the Milky Way — all we need is gravity.

But astronomers have seen something strange in the vast expanses between galaxies that seems to defy gravity — space itself is expanding.
Do you think this expansion affects our ability to communicate with faraway galaxies?
Yes, a lotMaybe a littleNo, not at all
Actually, this seemingly distant effect has important intergalactic consequences. Let’s see why.
Dec 14, 2025
Expansive Effects
To understand our neighborhood — the Moon, the Sun, and the rest of the Milky Way — all we need is gravity.

But astronomers have seen something strange in the vast expanses between galaxies that seems to defy gravity — space itself is expanding.
Do you think this expansion affects our ability to communicate with faraway galaxies?
Yes, a lotMaybe a littleNo, not at all
Actually, this seemingly distant effect has important intergalactic consequences. Let’s see why.
Dec 14, 2025
Claude Agent Skills 系统深度解析
📋 目录
• 概述
• 核心概念
• Skills 构建指南
• SKILL.md 编写规范
• 常见设计模式
• 内部架构
• 完整执行生命周期
• 参考资源
概述
Claude 的 Agent Skills 系统是一个基于提示词的元工具架构,通过专门的指令注入来扩展 LLM 能力。与传统的函数调用或代码执行不同,skills 通过提示词扩展和上下文修改来改变 Claude 处理后续请求的方式,而不需要编写可执行代码。
关键特性
• 非代码执行:Skills 不运行 Python/JavaScript,没有 HTTP 服务器或函数调用
• 提示词模板:专门的提示词模板,向对话上下文注入领域特定指令
• 动态上下文修改:修改对话上下文(注入指令)和执行上下文(更改工具权限和模型)
• 声明式发现:基于文本描述的技能发现和调用,由 Claude 的语言理解决定
核心概念
Tools vs Skills 对比
方面
传统工具 (Tools)
技能 (Skills)
执行模型
同步、直接执行
提示词扩展
目的
执行特定操作
指导复杂工作流
返回值
立即结果
对话上下文 + 执行上下文变更
示例
Read, Write, Bash
internal-comms, skill-creator
并发性
Dec 14, 2025
Claude Agent Skills 系统深度解析
📋 目录
• 概述
• 核心概念
• Skills 构建指南
• SKILL.md 编写规范
• 常见设计模式
• 内部架构
• 完整执行生命周期
• 参考资源
概述
Claude 的 Agent Skills 系统是一个基于提示词的元工具架构,通过专门的指令注入来扩展 LLM 能力。与传统的函数调用或代码执行不同,skills 通过提示词扩展和上下文修改来改变 Claude 处理后续请求的方式,而不需要编写可执行代码。
关键特性
• 非代码执行:Skills 不运行 Python/JavaScript,没有 HTTP 服务器或函数调用
• 提示词模板:专门的提示词模板,向对话上下文注入领域特定指令
• 动态上下文修改:修改对话上下文(注入指令)和执行上下文(更改工具权限和模型)
• 声明式发现:基于文本描述的技能发现和调用,由 Claude 的语言理解决定
核心概念
Tools vs Skills 对比
方面
传统工具 (Tools)
技能 (Skills)
执行模型
同步、直接执行
提示词扩展
目的
执行特定操作
指导复杂工作流
返回值
立即结果
对话上下文 + 执行上下文变更
示例
Read, Write, Bash
internal-comms, skill-creator
并发性
Dec 14, 2025
url: https://learning.oreilly.com/library/view/prompt-engineering-for/9781098153427/ch01.html
title: "Prompt Engineering for Generative AI"
description: "Chapter 1. The Five Principles of Prompting A Note for Early Release Readers With Early Release ebooks, you get books in their earliest form—the authors’ raw and unedited content as … - Selection from Prompt Engineering for Generative AI [Book]"
host: learning.oreilly.com
image: https://www.oreilly.com/library/cover/9781098153427/1200w630h/
第一章
这一章介绍了提示工程在生成式AI中的重要性。我们定义了提示工程是开发有效提示的过程,以获得与AI模型交互时所需的结果。你发现提供明确的指导、格式化输出、结合示例、建立评估体系以及将复杂任务分解为更小提示是提示工程的关键原则。通过应用这些原则并使用常见的提示技术,你可以提高AI生成输出的质量和可靠性。你还探讨了提示工程在生成产品名称和图像方面的作用。你看到指定所需格式并提供指导性示例如何极大地影响AI的输出。此外,你还了解到角色扮演的概念,你可以要求AI以著名人物(如史蒂夫·乔布斯)的身份生成输出。本章强调了在使用生成式AI模型时,需要明确的指导和背景才能实现预期结果。此外,你还发现了评估AI模型性能的重要性以及用于测量结果的各种方法,以及质量与令牌使用、成本和延迟之间的权衡。
在下一章中,你将了解文本生成模型。你将学习不同类型的基础模型及其功能,以及它们的局限性。该章还将回顾OpenAI的标准产品,以及竞争对手和开源替代方案。到本章结束时,你将对文本生成模型的历史以及它们的相对优缺点有深入的了解。本书将在第7、8和9章中再次涉及图像生成提示,所以如果这是你当前的需求,你可以自由跳到那些章节。准备好深入探讨提示工程的学科,并扩展你与AI合作的舒适区吧。

第二章
第2章 文本生成的大型语言模型简介在人工智能领域,大型语言模型的发展一直是近期的重点关注点。与之前较为僵化的模型不同,LLM能够处理和学习更大量的数据,从而产生出与人类语言输出非常相似的文本。这些模型已经泛化到了多种应用领域,从内容创作到软件开发自动化,再到实时交互式聊天机器人体验。
什么是文本生成模型?文本生成模型利用先进的算法来理解文本的含义,并产生出与人类作品难以区分的输出。如果你曾与ChatGPT互动过,或对它能够创造出连贯且与上下文相关的句子感到惊叹,那就是你亲眼见证了LLM的强大功能。在自然语言处理(NLP)和LLM中,基本的语言单元是令牌(token)。令牌可以代表句子、单词或者甚至是字符组合等子词。了解文本数据大小的一个有用方法是查看它包含的令牌数量;例如,一段100个令牌的文本大约相当于75个单词。这种比较在管理LLM的处理限制时可能很关键,因为不同模型的令牌容量可能会有所不同。分词(tokenization),即将文本分解为令牌的过程,是为NLP任务准备数据的关键步骤。可以使用多种分词方法,包括字节对编码(BPE)、WordPiece和SentencePiece。每种方法都有其独特的优势,适用于不同的使用场景。由于其在处理广泛词汇量的同时保持令牌数量可控的效率,BPE是最常用的方法。BPE最初将文本视为一系列独立的字符。随后,它会将经常一起出现的字符组合成单个单元,即令牌。为了更好地理解这一过程,让我们以单词"apple"为例。起初,BPE可能会将其视为a、p、p、l和e。但在注意到p通常出现在a和l之间之后,它可能会将appl组合成一个单一的令牌,以便在未来的实例中使用。这种方法有助于LLM识别和生成即使在训练数据中并不常见的单词或短语,使模型更加适应性和多功能性。要理解LLM的工作原理,需要掌握支撑这些系统的数学原理。尽管计算过程可能很复杂,但我们可以简化核心要素,以直观地理解这些模型的运作方式。特别是在商业背景下,LLM的准确性和可靠性至关重要。实现这种可靠性的关键在于LLM开发的预训练和微调阶段。在预训练阶段,模型首先在大量数据集上进行训练,获得对语言的广泛理解。随后,在微调阶段,模型会针对特定任务进行调整,提高其为专门应用提供准确可靠输出的能力。向量表示:语言的数值本质
在NLP领域,单词不仅仅是字母符号。它们可以被分词,然后以数值形式表示,即向量。这些向量是捕捉语义和语法关系的多维数字数组:
该图展示了词向量或词嵌入在自然语言处理中的概念。词嵌入是一种表示方法,通过这种方法,词语被映射到高维空间中的实数向量,根据它们的意义和与其他词语的关系进行分布。以下是关键点的详细说明:
1. 词向量表示:
w \rightarrow \mathbf{v} = [v_1, v_2, \ldots, v_n]
Dec 14, 2025
The rapid pace of innovation in generative AI promises to change how we live and work, but it’s getting increasingly difficult to keep up. The number of [AI papers published on arXiv is growing exponentially](https://oreil.ly/EN5ay), [Stable Diffusion](https://oreil.ly/QX-yy) has been among the fastest growing open source projects in history, and AI art tool [Midjourney’s Discord server](https://oreil.ly/ZVZ5o) has tens of millions of members, surpassing even the largest gaming communities. What most captured the public’s imagination was OpenAI’s release of ChatGPT, [which reached 100 million users in two months](https://oreil.ly/FbYWk), making it the fastest-growing consumer app in history. Learning to work with AI has quickly become one of the most in-demand skills.
生成式人工智能的快速创新有望改变我们的生活和工作方式,但跟上它变得越来越困难。 arXiv 上发表的 AI 论文数量呈指数级增长,Stable Diffusion 已成为历史上增长最快的开源项目之一,AI 艺术工具 Midjourney 的 Discord 服务器拥有数千万会员,甚至超过了最大的游戏社区。最激发公众想象力的是OpenAI发布的ChatGPT,两个月内用户数量就达到1亿,成为历史上增长最快的消费类应用程序。学习使用人工智能已迅速成为最受欢迎的技能之一。